#include "stdafx.h"
#include "iowrap.h"


FILE* iowrap_fopen(const char* fname, const char* mode)
{

    FILE* f = fopen(fname,mode);

    return f;
}

long iowrap_readString(std::string& st, FILE* fhandler)
{
    long fh = ftell(fhandler)+1;

    char outch[1025];
    st.clear();

    if (fgets(outch, 1024, fhandler)) 
    {

        while (outch[0] == ' ')
            for (int j=0; j<1025; j++)
                outch[j] = outch[j+1];

        st.append(outch);

    }
    else {
        st.clear();
        fh = 0;

    }

    return fh;

}